﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace elcalc
{
    public partial class frmTrafo : Form
    {
        public delegate void TransformerUpdateHandler(object sender, Transformer t);
        public event TransformerUpdateHandler TransformerUpdated;

        public frmTrafo()
        {
            InitializeComponent();
            cmbSpænding.SelectedIndex = 0;
            txtIkmax.Text = "1";
            txtIkmin.Text = "1";
            txtPhiIkmax.Text = "1";
            txtPhiIkmin.Text = "1";
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            
           Transformer oTrans = new Transformer();
            oTrans.ikmax = float.Parse(txtIkmax.Text);
            oTrans.ikmin = float.Parse(txtIkmin.Text);
            oTrans.phiikmax = float.Parse(txtPhiIkmax.Text);
            oTrans.phiikmin = float.Parse(txtPhiIkmin.Text);

            TransformerUpdated(this, oTrans);
        }
    }
}
